home *** CD-ROM | disk | FTP | other *** search
- Path: news.chalmers.se!sunic!EU.net!uunet!europa.eng.gtefsd.com!newsxfer.itd.umich.edu!nntp.cs.ubc.ca!cs.ubc.ca!cs.ubc.ca!not-for-mail
- From: seiler@cs.ubc.ca (Oliver Seiler)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: BorderTop/BorderBottom etc..
- Date: 8 Jun 1994 23:54:59 -0700
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Lines: 49
- Message-ID: <2t6ec3$26h@cascade.cs.ubc.ca>
- References: <1994Jun8.012806.583@hitech.po.my>
- NNTP-Posting-Host: cascade.cs.ubc.ca
-
- In article <1994Jun8.012806.583@hitech.po.my>,
- Terence Tan <terence@hitech.po.my> wrote:
- >Quick questions:
- >1. What is the best way to findout the inner width/height of a window
- > (Currently I use [Where pWdw is a struct Window pointer]
- > pWdw->Width - pWdw->BorderLeft - pWdw->BorderRight or
-
- This is because these fields measure different things. Generally if
- you are subtracting and adding widths and border values you are going
- to have to add or subtract a bit (to get it right the first time
- try to figure out the offsets using an imaginary "small" window, with
- maybe a one pixel wide border, in which case win->BorderLeft is 1,
- a drawing area width of 0, etc... Then just scale up...)
-
- > pWdw->Height - pWdw->BorderTop - pWdw->BorderBottom). It doesn't
- > seem to do it properly cause I usually have to adjust it by 1 -2
- > pixels.
-
- Use win->BorderTop, win->BorderLeft, etc. if you have the window's open. This
- gives you the position of the first location *not* in the border. Before
- opening, use the screen fields WBorLeft, WBorTop, etc (WBorTop doesn't
- include the title bar, so add scr->Font->ta_YSize+1.) WBorRight and WBorBottom
- may not be good to use if you aren't using the standard right and bottom
- border settings...
-
- To get the width and height of the non-border area of a window use
- win->GZZWidth and win->GZZHeight. (Yes this works for non-GZZ windows -
- read the RKMs)
-
- >2. Does pWdw->BorderTop take into account the drag bar at the top?
- > Is it font sensitive?
-
- Yes to both. I usually just use win->BorderTop+INTERHEIGHT for all my gadgets,
- etc..
-
- If the window isn't open, use scr->WBorTop+scr->Font->ta_YSize+1 to get the
- same value as win->BorderTop...
-
- >3. Best way to clear a window?[BltClear??]
-
- I'd avoid using the blitter for future compatibility reasons... Umm.
- SetRast() followed by RefreshWindowFrame() would probably be fast. Even
- better, avoid the RefreshWindowFrame() and use RectFill() on the window's
- rastport (being sure to set the proper background color - best way of
- getting this is using the DrawInfo pens array...)
-
- -Oliver
-